import { defineStore } from 'pinia'

export const useCounterStore = defineStore({
  id: 'counter',
  state: () => ({
    counter: 0,
    //购物车
    shopcar: {
      //总价
      num:0,
      shops: [
        {
          shop: {
            //商品id
            shopid: "",
            //商品名称
            shopname: "",
            img: "",
            price: 0,
            //医院名
            hospitalname: ""
          },
          num: 0
        }
      ],
      //留言
      leavemessage:""
    }
  }),
  getters: {
    doubleCount: (state) => state.counter * 2
  },
  actions: {
    increment() {
      this.counter++
    }
  }
})
